<template>
    <div>
        <div v-if="progressList.length > 0">
            <p v-for="(item, index) in progressList" :key="index">
                {{ index + 1 }}号仓：
                <el-button size="mini" :loading="true" v-if="item.result == '0'"
                    >开仓中···</el-button
                >
                <el-button type="success" size="mini" v-if="item.result == '1'"
                    >开仓成功</el-button
                >
                <el-button type="error" size="mini" v-if="item.result == '2'"
                    >开仓失败</el-button
                >
            </p>
        </div>
        <div v-else>
            <p v-for="(item, index) in forbidList" :key="index">
                {{ index + 1 }}号仓：
                <!-- status:1：禁用 2：启用 result:0进行中；1成功；2失败；3已经是当前状态，不可操作 -->
                <el-button size="mini" :loading="true" v-if="item.result == '0'"
                    ><span v-if="item.status == '1'">禁用中···</span>
                    <span v-else>解禁中···</span>
                </el-button>
                <el-button type="success" size="mini" v-if="item.result == '1'"
                    ><span v-if="item.status == '1'">禁用</span
                    ><span v-else>解禁</span>成功</el-button
                >
                <el-button type="error" size="mini" v-if="item.result == '2'"
                    ><span v-if="item.status == '1'">禁用</span
                    ><span v-else>解禁</span>失败</el-button
                >
            </p>
        </div>
        <span slot="footer" class="dialog-footer">
            <el-button
                type="primary"
                plain
                size="small"
                @click="handleCloseProcess"
                >关 闭</el-button
            >
        </span>
    </div>
</template>

<script>
export default {
    props: {
        progressList: {
            typeof: Array,
            default: () => [],
        },
        forbidList: {
            typeof: Array,
            default: () => [],
        },
    },
    watch: {
        progressList: {
            handler() {},
            deep: true,
            immediate: true,
        },
        forbidList: {
            handler() {},
            deep: true,
            immediate: true,
        },
    },
    methods: {
        handleCloseProcess() {
            this.$emit("handleCloseProcess");
        },
    },
};
</script>

<style lang="scss" scoped></style>
